package song.NO_21;

import java.util.Comparator;

public class Node implements Comparator<Node> {
    private int num;
    private Node next = null;
    public Node(){
        this.num = 0;
    }
    public Node(final int num){
        this.num = num;
    }
    public int num_return() {
        return this.num;
    }
    public void setNum(final int num){
        this.num = num;
    }
    public Node next_return(){
        return this.next;
    }
    public void setNext(final Node next){
        this.next = next;
    }

    @Override
    public int compare(Node node1, Node node2) {
//        if (node1.num_return() > node2.num_return()) return 1;
//        else if (node1.num_return() == node2.num_return()) return 0;
//        else return -1;
        return Integer.compare(node1.num_return(), node2.num_return());
    }
}
